home *** CD-ROM | disk | FTP | other *** search
/ Cream of the Crop 26 / Cream of the Crop 26.iso / program / ddj0897.zip / DYN401.ZIP / utils / startup.mk
Text File  |  1996-07-18  |  4KB  |  160 lines

  1. # MSDOS DMAKE startup file.  Customize to suit your needs.
  2. # Assumes MKS toolkit for the tool commands, and Microsoft C.  Change as req'd.
  3. # See the documentation for a description of internally defined macros.
  4. #
  5. # Disable warnings for macros redefined here that were given
  6. # on the command line.
  7. __.SILENT !:= $(.SILENT)
  8. .SILENT   !:= yes
  9.  
  10. # Custimizations
  11. .SWAP := yes
  12. .DIRCACHE := no
  13.  
  14. NAMEMAX = 200
  15.  
  16. # Configuration parameters for DMAKE startup.mk file
  17. # Set these to NON-NULL if you wish to turn the parameter on.
  18. _HAVE_RCS    :=         # yes => RCS  is installed.
  19. _HAVE_SCCS    :=         # yes => SCCS is installed.
  20.  
  21. # Applicable suffix definitions
  22. A := .lib    # Libraries
  23. E := .exe    # Executables
  24. F := .for    # Fortran
  25. O := .obj    # Objects
  26. P := .pas    # Pascal
  27. S := .asm    # Assembler sources
  28. V :=         # RCS suffix
  29.  
  30. # See if these are defined
  31. TMPDIR := $(ROOTDIR)/tmp
  32. #.IMPORT .IGNORE : TMPDIR SHELL COMSPEC
  33. .IMPORT .IGNORE : TMPDIR COMSPEC
  34.  
  35. # Recipe execution configurations
  36. # First set SHELL, If it is not defined, use COMSPEC, otherwise
  37. # it is assumed to be MKS Korn SHELL.
  38. .IF $(SHELL) == $(NULL)
  39. .IF $(COMSPEC) == $(NULL)
  40.    SHELL := $(ROOTDIR)/bin/sh$E
  41. .ELSE
  42.    SHELL := $(COMSPEC)
  43. .END
  44. .END
  45. GROUPSHELL := $(SHELL)
  46.  
  47. # Now set remaining arguments depending on which SHELL we
  48. # are going to use.  COMSPEC (assumed to be command.com) or
  49. # MKS Korn Shell.
  50. .IF $(SHELL)==$(COMSPEC)
  51.    SHELLFLAGS  := /c
  52.    GROUPFLAGS  := $(SHELLFLAGS)
  53.    SHELLMETAS  := "<>|'&
  54.    GROUPSUFFIX := .bat
  55.    DIRSEPSTR   := \\\
  56.    DIVFILE      = $(TMPFILE:s,/,\)
  57. .ELSE
  58.    SHELLFLAGS  := -c
  59.    GROUPFLAGS  := 
  60.    SHELLMETAS  := *"?<>|()&][$$\#`'
  61.    GROUPSUFFIX := .ksh
  62.    .MKSARGS    := yes
  63.    DIVFILE      = $(TMPFILE:s,/,${DIVSEP_shell_${USESHELL}})
  64.    DIVSEP_shell_yes := \\\
  65.    DIVSEP_shell_no  := \\
  66. .END
  67.  
  68. # Standard C-language command names and flags
  69.    CC      := cl        # C-compiler and flags
  70.    CFLAGS  +=
  71.  
  72.    AS      := tasm        # Assembler and flags
  73.    ASFLAGS +=
  74.  
  75.    LD       = link        # Loader and flags
  76.    LDFLAGS +=
  77.    LDLIBS   =
  78.  
  79. # Definition of $(MAKE) macro for recursive makes.
  80.    MAKE = $(MAKECMD) -S $(MFLAGS)
  81.  
  82. # Language and Parser generation Tools and their flags
  83.    YACC      := yacc        # standard yacc
  84.    YFLAGS +=
  85.    YTAB      := ytab        # yacc output files name stem.
  86.  
  87.    LEX      := lex        # standard lex
  88.    LFLAGS +=
  89.    LEXYY  := lex_yy        # lex output file
  90.  
  91. # Other Compilers, Tools and their flags
  92.    PC    := any_pc        # pascal compiler
  93.    RC    := anyf77        # ratfor compiler
  94.    FC    := anyf77        # fortran compiler
  95.  
  96.    CO       := co        # check out for RCS
  97.    COFLAGS += -q
  98.  
  99.    AR     := ar            # archiver
  100.    ARFLAGS+= ruv
  101.  
  102.    RM       := rm        # remove a file command
  103.    RMFLAGS +=
  104.  
  105. # Implicit generation rules for making inferences.
  106. # We don't provide .yr or .ye rules here.  They're obsolete.
  107. # Rules for making *$O
  108.    %$O : %.c ; $(CC) $(CFLAGS) -c $<
  109.    %$O : %$P ; $(PC) $(PFLAGS) -c $<
  110.    %$O : %$S ; $(AS) $(ASFLAGS) $(<:s,/,\);
  111.    %$O : %.cl ; class -c $<
  112.    %$O :| %.e %.r %.F %$F ; $(FC) $(RFLAGS) $(EFLAGS) $(FFLAGS) -c $<
  113.  
  114. # Executables
  115.    %$E : %$O ; $(CC) $(LDFLAGS) -o$@ $< $(LDLIBS)
  116.  
  117. # lex and yacc rules
  118.    %.c : %.y ; $(YACC)  $(YFLAGS) $<; mv $(YTAB).c $@
  119.    %.c : %.l ; $(LEX)   $(LFLAGS) $<; mv $(LEXYY).c $@
  120.  
  121. # RCS support
  122. .IF $(_HAVE_RCS)
  123.    % : $$(@:d)RCS$$(DIRSEPSTR)$$(@:f)$V;- $(CO) $(COFLAGS) $@
  124.    .NOINFER : $$(@:d)RCS$$(DIRSEPSTR)$$(@:f)$V
  125. .END
  126.  
  127. # SCCS support
  128. .IF $(_HAVE_SCCS)
  129.    % : s.% ; get $<
  130.    .NOINFER : s.%
  131. .END
  132.  
  133. # Recipe to make archive files.
  134. %$A .SWAP .GROUP :
  135.     $(AR) $(ARFLAGS) $@ $?
  136.     $(RM) $(RMFLAGS) $?
  137.  
  138. # DMAKE uses this recipe to remove intermediate targets
  139. .REMOVE :; $(RM) -f $<
  140.  
  141. # AUGMAKE extensions for SYSV compatibility
  142. "@B" = $(@:b)
  143. "@D" = $(@:d)
  144. "@F" = $(@:f)
  145. "*B" = $(*:b)
  146. "*D" = $(*:d)
  147. "*F" = $(*:f)
  148. "<B" = $(<:b)
  149. "<D" = $(<:d)
  150. "<F" = $(<:f)
  151. "?B" = $(?:b)
  152. "?F" = $(?:f)
  153. "?D" = $(?:d)
  154.  
  155. # Turn warnings back to previous setting.
  156. .SILENT !:= $(__.SILENT)
  157.  
  158. # Local init file if any, gets parsed before user makefile
  159. .INCLUDE .IGNORE: "_startup.mk"
  160.